public class QueShiDeShuZiLcof {
    // 缺失的数字 https://leetcode.cn/problems/que-shi-de-shu-zi-lcof/
    public int takeAttendance(int[] records) {
        int left=0,right=records.length;
        while(left<right) {
            int mid=left+(right-left)/2;
            if(mid==records[mid]) left=mid+1;
            else right=mid;
        }
        return left;
    }
}
